﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GestionePolveriLib.BL;

namespace GestionePolveri2.Editors
{
    public partial class LottoNCEditor : Form
    {
        private LottoNCInfo m_lottoNCInfo = null;

        public LottoNCInfo LottoNCInfo
        {
            get { return m_lottoNCInfo; }
            set 
            { 
                m_lottoNCInfo = value;

                this.lottoNCDettaglio1.LottoNCInfo = m_lottoNCInfo;
            }
        }

        public LottoNCEditor()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            m_lottoNCInfo = this.lottoNCDettaglio1.LottoNCInfo;

            //if (this.lottoNCDettaglio1.Save())
            //{
            //    MessageBox.Show("Informazioni Lotto Non Conforme salvate correttamente!", "Gestione Polveri", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //}

            this.Close();
        }

        public bool Save()
        {
            bool retValue = false;

            retValue = this.lottoNCDettaglio1.Save();

            return retValue;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
